package com.jimmy.nonweb.data.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.sql.Timestamp;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.PositiveOrZero;
import jakarta.validation.constraints.Size;

@Data
@TableName("commit_log")
public class CommitLog {
    @TableId
    private String id;
    @NotBlank(message = "gitInstance 不能为空")
    private String gitInstance;

    private Long repositoryId;
    private String branchId;
    private String email;
    private String committerFullname;
    private Timestamp createdAt;

    @PositiveOrZero(message = "additions 必须是非负数")
    private Integer additions;

    @PositiveOrZero(message = "deletions 必须是非负数")
    private Integer deletions;

    @PositiveOrZero(message = "totalChanges 必须是非负数")
    private Integer totalChanges;

    @Size(max = 500, message = "message 长度不能超过500字符")
    private String message;

    private String webUrl;
    private Integer commitType;
    private Timestamp updatedAt;
}